/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.great.functionalCore;

import br.great.beans.Address;
import br.great.beans.Photo;
import br.great.beans.Wiki;
import java.util.Calendar;
import java.util.Vector;

/**
 *
 * @author Drazzco
 */
public class AnnotationGenerator {

    public  AnnotationGenerator(){

      }

    public void interpretationPhoto(Photo p){

        System.out.println("near by wikipedia articles...");
        Vector<Wiki> articles = WikipediaObjectDerivator.getDerivatedObject(p.getCoor());
        p.setNearByWikipediaObject(articles);

         AddressDerivator addresDeriv=new AddressDerivator();
         Address ad = new Address();
         try{
        ad = addresDeriv.deriveAddress(p.getCoor());
         } catch (NullPointerException ex) {
             System.out.println("Null é aqui");
         }
        p.setAddress(ad);
        Calendar cal= Calendar.getInstance();
        if (p.getDateTime()!=null){
            cal.setTime(p.getDateTime());
            String s = SeasonCalculator.calculateSeason(cal.getTime(),p.getCoor().getLatitude());
            p.setSeason(s);
        }
        /*progressBar.setValue(progress++);
        labelProgression.setText("address...");
        AddressDerivator addresDeriv=new AddressDerivator();
        Address ad = addresDeriv.deriveAddress(p.getCoor());
        p.setAddress(ad);
        progressBar.setValue(progress++);
        labelProgression.setText("season...");
        Calendar cal= Calendar.getInstance();
        if (p.getDateTime()!=null){
            cal.setTime(p.getDateTime());
            String s = SeasonCalculator.calculateSeason(cal.getTime(),p.getCoor().getLatitude());
            p.setSeason(s);
        }
        progressBar.setValue(progress++);
         * */

    }

}
